<html>
<head><meta charset="utf-8"><title>name resolution is stuck · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html">name resolution is stuck</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="185439369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439369">(Jan 12 2020 at 15:57)</a>:</h4>
<p>I'm getting the following error in one of my projects:</p>
<div class="codehilite"><pre><span></span>[2020-01-10T23:31:07Z ERROR ra_hir_def::nameres::collector] name resolution is stuck
</pre></div>


<p>Unfortunately it's closed-source so I can't share the code. I can however help to debug the problem if you can suggest any direction to start looking.</p>



<a name="185439433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439433">(Jan 12 2020 at 15:59)</a>:</h4>
<p><span class="user-mention" data-user-id="143274">@Amanieu</span> could you check if it is stuck with this commit reverted: <a href="https://github.com/rust-analyzer/rust-analyzer/commit/9dc1826cfaa75983a83f9eb7f788067d5dedf5a7" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/commit/9dc1826cfaa75983a83f9eb7f788067d5dedf5a7">https://github.com/rust-analyzer/rust-analyzer/commit/9dc1826cfaa75983a83f9eb7f788067d5dedf5a7</a> ?</p>



<a name="185439434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439434">(Jan 12 2020 at 15:59)</a>:</h4>
<p>(that's just a while guess, but, if this is a regressio, the above commit is a likely culprit)</p>



<a name="185439486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439486">(Jan 12 2020 at 16:00)</a>:</h4>
<p>Hmm how do I check my rust-analyzer version?</p>



<a name="185439487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439487">(Jan 12 2020 at 16:00)</a>:</h4>
<p>actually wait</p>



<a name="185439492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439492">(Jan 12 2020 at 16:00)</a>:</h4>
<p><code>ra_lsp_server --version</code></p>



<a name="185439493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439493">(Jan 12 2020 at 16:00)</a>:</h4>
<p>My build is <a href="https://github.com/rust-lang/rust/commit/d5abe4cfddd5c6e14100f20d27d3de38fe7201f5" target="_blank" title="https://github.com/rust-lang/rust/commit/d5abe4cfddd5c6e14100f20d27d3de38fe7201f5">d5abe4cfddd5c6e14100f20d27d3de38fe7201f5</a>, from Jan 8</p>



<a name="185439494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439494">(Jan 12 2020 at 16:00)</a>:</h4>
<p>It should print commit</p>



<a name="185439499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439499">(Jan 12 2020 at 16:01)</a>:</h4>
<p>Ah, so this is pre-existing, which makes it more fun</p>



<a name="185439550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439550">(Jan 12 2020 at 16:02)</a>:</h4>
<p>I would try updating rust-analyzer then first, we landed a couple of fixes to macros and that one about name resolution</p>



<a name="185439565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439565">(Jan 12 2020 at 16:03)</a>:</h4>
<p>In general, I am afraid that the only way to debug thouse kinds of bug is by minimizing reproducible example, and we don't have tools to automate that unfortunatelly</p>



<a name="185439676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439676">(Jan 12 2020 at 16:07)</a>:</h4>
<p>Is there a way to find out which name/macro it can't resolve?</p>



<a name="185439683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439683">(Jan 12 2020 at 16:07)</a>:</h4>
<p>Unfortunately this is quite a big project with 50k lines and 14 crates in a workspace.</p>



<a name="185439921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439921">(Jan 12 2020 at 16:14)</a>:</h4>
<p>Huh it seems to work now</p>



<a name="185439924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185439924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185439924">(Jan 12 2020 at 16:14)</a>:</h4>
<p>But it's been rather on and off, sometimes working, sometimes not.</p>



<a name="185440844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/name%20resolution%20is%20stuck/near/185440844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/name.20resolution.20is.20stuck.html#185440844">(Jan 12 2020 at 16:45)</a>:</h4>
<p>Yeah, unfortunately we dont' have a way to print the offending bit of code. I guess, we should just change the panic message there to give more info, at least the crate name (which is actually non-trivial: we are very careful to only expose opaque ids of things, and not their names, to help with incrementality. And this really hurts when you try to debug things)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>